/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package it.polimi.meteocal.entity;

import java.io.Serializable;
import java.util.Calendar;
import java.util.Collection;
import java.util.GregorianCalendar;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Temporal;

/**
 *
 * @author paolo
 */
@Entity
public class Forecast implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    /*ATTRIBUTE*/
    
    @Id
    @GeneratedValue(strategy = GenerationType.AUTO)
    private Long forecastID;
    
    private String city;
    
    private String country;
    
    @Temporal(javax.persistence.TemporalType.DATE)
    private GregorianCalendar forecastDate;
    
    @Temporal(javax.persistence.TemporalType.TIMESTAMP)
    private GregorianCalendar updateDate;
    
    private int forecast;
    
    /*RELATIONSHIP*/
    
    //FORECAST-EVENT
    @OneToMany(mappedBy = "forecast")
    private Collection<Event> eventCollection;

    public Long getForecastID() {
        return forecastID;
    }

    public void setForecastID(Long forecastID) {
        this.forecastID = forecastID;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public GregorianCalendar getForecastDate() {
        return forecastDate;
    }

    public void setForecastDate(GregorianCalendar forecastDate) {
        this.forecastDate = forecastDate;
    }

    public GregorianCalendar getUpdateDate() {
        return updateDate;
    }

    public void setUpdateDate(GregorianCalendar updateDate) {
        this.updateDate = updateDate;
    }

    public Collection<Event> getEventCollection() {
        return eventCollection;
    }

    public void setEventCollection(Collection<Event> eventCollection) {
        this.eventCollection = eventCollection;
    }

    public int getForecast() {
        return forecast;
    }

    public void setForecast(int forecast) {
        this.forecast = forecast;
    }
    
    
}
